package org.td.engine.combat;

import org.td.engine.combat.effect.Effect;
import org.td.engine.entity.tower.Turret;

public class SimpleWeapon extends AbstractWeapon {

    public SimpleWeapon(WeaponClass weaponClass, Turret owner) {
        super(weaponClass, owner);
    }

    @Override
    public void fire(Target target) {
        if (!isCharged()) {
            return;
        }

        Effect e = weaponClass.getAttackEffect();
        e.apply(owner, target);

        cooldown = weaponClass.getCooldown();
    }
}
